<!DOCTYPE html>
<html lang="en">
<head>
    {include file="public/meta" /}
    {include file="public/link" /}
    {include file="public/form" /}
</head>
<body data-type="index" class="theme-white">
<div class="am-g tpl-g">
    {include file="public/header" /}
    {include file="public/left" /}
    {include file="public/content_top" /}
    <ol class="am-breadcrumb" style="margin-bottom: 0;">
        <li><a href="../home/index.html" class="am-icon-home">首页</a></li>
        <li><a href="#">管理管理</a></li>
        <li class="am-active">修改密码</li>
    </ol>
    <div class="widget am-cf">
        <form class="am-cf" id="form" onsubmit="return false">
            <div class="am-panel am-panel-primary">
                <div class="am-panel-hd">修改密码</div>
                <div class="am-panel-bd">
                    <div class="am-form-group">
                        <span class="s1">用户名：</span>
                        <label class="am-form-label">
                            <input type="text" class="am-form-field am-input-sm" readonly value="{$user['name']}" name=""/>
                        </label>
                        <span class="s2"></span>
                    </div>
                    <div class="am-form-group">
                        <span class="s1">旧密码：</span>
                        <label class="am-form-label">
                            <input type="password" class="am-form-field am-input-sm" value="" name="password"/>
                        </label>
                        <span class="s2"></span>
                    </div>
                    <div class="am-form-group">
                        <span class="s1">新密码：</span>
                        <label class="am-form-label">
                            <input type="password" class="am-form-field am-input-sm" value="" name="new"/>
                        </label>
                        <span class="s2"></span>
                    </div>
                    <div class="am-form-group">
                        <span class="s1">确认密码：</span>
                        <label class="am-form-label">
                            <input type="password" class="am-form-field am-input-sm" value="" name="confirm"/>
                        </label>
                        <span class="s2"></span>
                    </div>
                </div>
                <div class="am-panel-bd" style="padding-bottom: 1rem;margin-left: 13rem">
                    <button class="am-btn am-btn-primary am-btn-sm" onclick="sub()">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="public/foot"/}
<script type="text/javascript">
    $(function () {
        var nav = $('.left-sidebar li.sidebar-nav-link');
        nav.removeClass("active");
        nav.eq({$a}).find('ul').show();
        nav.eq({$a}).find('ul li').eq({$b}).find('a').addClass('active');
    });
    function sub() {
        var arr = parseFormJson("#form");
        $.ajax({
            url: "{:url('Home/password_handle')}",
            type: "POST",
            data: {arr: arr},
            success: function (data) {
                if (data['code'] == 1) {
                    alert_open(data['msg']);
                } else {
                    alert_msg(data['msg']);
                }
            }
        });
    }
</script>
</body>
</html>